<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateFileUploadTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('file_upload', function (Blueprint $table) {
            $table->bigIncrements('id');
            //ie最url的mtu为2083
            $table->string('local_url',2083)->comment('图片上传保存在服务器的url')->nullable()->default('null');
            $table->string('local_path',2083)->comment('图片上传保存在服务器的位置')->nullable()->default('null');
            $table->string('remote_url',2083)->comment('图片上传保存在远程服务器的url')->nullable()->default('null');
            $table->string('tx_url',2083)->comment('图片上传保存在腾讯服务器的url')->nullable()->default('null');;
            $table->string('ali_url',2083)->comment('图片上传保存在阿里服务器的url')->nullable()->default('null');;
            $table->string('qiniu_url',2083)->comment('图片上传保存在七牛服务器的url')->nullable()->default('null');;
            $table->tinyInteger('type')->comment('video 2,image 1')->nullable();
            $table->unsignedInteger('user_id')->comment('上传用户的id号')->nullable();
            $table->unsignedTinyInteger('upload_user_type')->comment('上传用户的类型 1. 病人 2.商家 3. 医院后台')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('file_upload');
    }
}
